package cn.com.miao.lynx.plugin.job.quartz.wrapper;

import lombok.Data;

import java.util.HashMap;
import java.util.Map;

/**
 * JobParamWrapper
 *
 * @title: JobParamWrapper
 * @description:
 * @author: dengmiao
 * @create: 2020-01-14 15:10
 **/
@Data
public class JobParamWrapper {

    /**
     * 定时任务执行时的参数
     */
    private static Map<String, Object> param = new HashMap();

    /**
     * 实例化参数对象
     *
     * @return ApiBootJobParamWrapper Instance
     */
    public static JobParamWrapper wrapper() {
        return new JobParamWrapper();
    }

    /**
     * Put new param to map
     *
     * @param name  param name
     * @param value param value
     * @return this object
     */
    public JobParamWrapper put(String name, Object value) {
        param.put(name, value);
        return this;
    }

    /**
     * Get all params
     *
     * @return map instance
     */
    public Map<String, Object> getAllParam() {
        return param;
    }
}
